//
//  MainTab.swift
//  Twitter
//
//  Created by Hoa.wang on 2022/3/30.
//

import SwiftUI

struct MainTab: View {
    
    @State private var selection = 0
    
    var body: some View {
        TabView(selection: $selection) {
            FeedView().onTapGesture {
                self.selection = 0
            }
            .tabItem {
                Image(systemName: "house")
            }
            .tag(0)
            
            ExploreView().onTapGesture {
                self.selection = 1
            }
            .tabItem {
                Image(systemName: "magnifyingglass")
            }
            .tag(1)
            
            NotificationsView().onTapGesture {
                self.selection = 2
            }
            .tabItem {
                Image(systemName: "bell")
            }
            .tag(2)
            
            MessagesView().onTapGesture {
                self.selection = 3
            }
            .tabItem {
                Image(systemName: "envelope")
            }
            .tag(3)
        }
    }
}

struct MainTab_Previews: PreviewProvider {
    static var previews: some View {
        MainTab()
    }
}
